package com.lvkerry.orderfood.entity;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author Kerry
 */

@Entity
@Table(name = "t_order")
public class OrderEntity {
    private Long orderId;
    private String lunchDate;
    private Long orderTime;
    private Integer tableNo;
    private String orderNo;
    private String remark;
    /**
     * 0 堂吃
     * 1 打包
     * 2 取消
     * 3 售罄
     */
    private Integer orderStatus;

    private Long userId;
    private String username;
    private String name;

    private Long menuId;
    private String menuName;
    private String menuAvatarUrl;
    private BigDecimal price;


    @Id
    @Column(name = "order_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "lunch_date", length = 12, nullable = false)
    public String getLunchDate() {
        return lunchDate;
    }

    public void setLunchDate(String lunchDate) {
        this.lunchDate = lunchDate;
    }


    @Basic
    @Column(name = "order_time", nullable = false)
    public Long getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Long orderTime) {
        this.orderTime = orderTime;
    }

    @Basic
    @Column(name = "table_no", nullable = false)
    public Integer getTableNo() {
        return tableNo;
    }

    public void setTableNo(Integer tableNo) {
        this.tableNo = tableNo;
    }

    @Basic
    @Column(name = "order_no", nullable = false, unique = true, length = 60)
    public String getOrderNo() {
        return this.orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @Column(name = "remark", length = 200)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "order_status")
    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }


    @Basic
    @Column(name = "user_id", length = 40, nullable = false)
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "username", length = 40, nullable = false)
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "name", length = 200)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "menu_id")
    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }

    @Basic
    @Column(name = "menu_name", length = 200, nullable = false)
    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    @Basic
    @Column(name = "menu_avatar_url", length = 300)
    public String getMenuAvatarUrl() {
        return menuAvatarUrl;
    }

    public void setMenuAvatarUrl(String menuAvatarUrl) {
        this.menuAvatarUrl = menuAvatarUrl;
    }

    @Basic
    @Column(name = "price", columnDefinition = "NUMERIC(19, 5) NOT NULL")
    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }
}
